﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Guedes_Library
{
    public static class StringExtensions
    {
        public static string GetToolTip(this string source, int size)
        {
            if (source.Length < size)
                return source;
            int lastPosition = source.LastIndexOf(" ", size);
            return string.Concat(source.Substring(0, lastPosition), "...");
        }
    }
}
